<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, BangPatterns #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-comment">-- | Copyright   : (c) 2010-2011 Simon Meier</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- License       : BSD3-style (see LICENSE)</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Maintainer    : Simon Meier &lt;iridcode@gmail.com&gt;</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Portability   : GHC</span><span>
</span><span id="line-10"></span><span class="hs-comment">--</span><span>
</span><span id="line-11"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.ByteString.Builder.Prim.Binary</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span>  </span><span class="annot"><span class="hs-comment">-- ** Binary encodings</span></span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int8"><span class="hs-identifier">int8</span></a></span><span>
</span><span id="line-15"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word8"><span class="hs-identifier">word8</span></a></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span>  </span><span class="annot"><span class="hs-comment">-- *** Big-endian</span></span><span>
</span><span id="line-18"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16BE"><span class="hs-identifier">int16BE</span></a></span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32BE"><span class="hs-identifier">int32BE</span></a></span><span>
</span><span id="line-20"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64BE"><span class="hs-identifier">int64BE</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16BE"><span class="hs-identifier">word16BE</span></a></span><span>
</span><span id="line-23"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32BE"><span class="hs-identifier">word32BE</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64BE"><span class="hs-identifier">word64BE</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatBE"><span class="hs-identifier">floatBE</span></a></span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleBE"><span class="hs-identifier">doubleBE</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>  </span><span class="annot"><span class="hs-comment">-- *** Little-endian</span></span><span>
</span><span id="line-30"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16LE"><span class="hs-identifier">int16LE</span></a></span><span>
</span><span id="line-31"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32LE"><span class="hs-identifier">int32LE</span></a></span><span>
</span><span id="line-32"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64LE"><span class="hs-identifier">int64LE</span></a></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16LE"><span class="hs-identifier">word16LE</span></a></span><span>
</span><span id="line-35"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32LE"><span class="hs-identifier">word32LE</span></a></span><span>
</span><span id="line-36"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64LE"><span class="hs-identifier">word64LE</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatLE"><span class="hs-identifier">floatLE</span></a></span><span>
</span><span id="line-39"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleLE"><span class="hs-identifier">doubleLE</span></a></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span>  </span><span class="annot"><span class="hs-comment">-- *** Non-portable, host-dependent</span></span><span>
</span><span id="line-42"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#intHost"><span class="hs-identifier">intHost</span></a></span><span>
</span><span id="line-43"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16Host"><span class="hs-identifier">int16Host</span></a></span><span>
</span><span id="line-44"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32Host"><span class="hs-identifier">int32Host</span></a></span><span>
</span><span id="line-45"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64Host"><span class="hs-identifier">int64Host</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#wordHost"><span class="hs-identifier">wordHost</span></a></span><span>
</span><span id="line-48"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16Host"><span class="hs-identifier">word16Host</span></a></span><span>
</span><span id="line-49"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32Host"><span class="hs-identifier">word32Host</span></a></span><span>
</span><span id="line-50"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64Host"><span class="hs-identifier">word64Host</span></a></span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatHost"><span class="hs-identifier">floatHost</span></a></span><span>
</span><span id="line-53"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleHost"><span class="hs-identifier">doubleHost</span></a></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html"><span class="hs-identifier">Data.ByteString.Builder.Prim.Internal</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html"><span class="hs-identifier">Data.ByteString.Builder.Prim.Internal.UncheckedShifts</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.Floating.html"><span class="hs-identifier">Data.ByteString.Builder.Prim.Internal.Floating</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.html#"><span class="hs-identifier">Foreign</span></a></span><span class="hs-cpp">

#include &quot;MachDeps.h&quot;
</span><span>
</span><span id="line-65"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- Binary encoding</span><span>
</span><span id="line-67"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-comment">-- Word encodings</span><span>
</span><span id="line-70"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- | Encoding single unsigned bytes as-is.</span><span>
</span><span id="line-73"></span><span class="hs-comment">--</span><span>
</span><span id="line-74"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word8"><span class="hs-pragma hs-type">word8</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-75"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word8"><span class="hs-identifier hs-type">word8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span>
</span><span id="line-76"></span><span id="word8"><span class="annot"><span class="annottext">word8 :: FixedPrim Word8
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word8"><span class="hs-identifier hs-var hs-var">word8</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word8
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-comment">--</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- We rely on the fromIntegral to do the right masking for us.</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- The inlining here is critical, and can be worth 4x performance</span><span>
</span><span id="line-81"></span><span class="hs-comment">--</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- | Encoding 'Word16's in big endian format.</span><span>
</span><span id="line-84"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16BE"><span class="hs-pragma hs-type">word16BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-85"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16BE"><span class="hs-identifier hs-type">word16BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span class="hs-cpp">
#ifdef WORDS_BIGENDIAN
</span><span class="hs-identifier">word16BE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">word16Host</span><span class="hs-cpp">
#else
</span><span id="word16BE"><span class="annot"><span class="annottext">word16BE :: FixedPrim Word16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word16BE"><span class="hs-identifier hs-var hs-var">word16BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (Word16 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word16
forall a. Int -&gt; (a -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#fixedPrim"><span class="hs-identifier hs-var">fixedPrim</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">((Word16 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word16)
-&gt; (Word16 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word16
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679070787"><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679070787"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679070786"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070786"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-90"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070786"><span class="hs-identifier hs-var">p</span></a></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word16 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word16 -&gt; Int -&gt; Word16
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w16"><span class="hs-identifier hs-var">shiftr_w16</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679070787"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070786"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word16 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679070787"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- | Encoding 'Word16's in little endian format.</span><span>
</span><span id="line-95"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16LE"><span class="hs-pragma hs-type">word16LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-96"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16LE"><span class="hs-identifier hs-type">word16LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span class="hs-cpp">
#ifdef WORDS_BIGENDIAN
</span><span class="hs-identifier">word16LE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fixedPrim</span><span> </span><span class="hs-number">2</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">w</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">p</span><span>               </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">w</span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w16</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span id="word16LE"><span class="annot"><span class="annottext">word16LE :: FixedPrim Word16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word16LE"><span class="hs-identifier hs-var hs-var">word16LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word16Host"><span class="hs-identifier hs-var">word16Host</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- | Encoding 'Word32's in big endian format.</span><span>
</span><span id="line-106"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32BE"><span class="hs-pragma hs-type">word32BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-107"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32BE"><span class="hs-identifier hs-type">word32BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-cpp">
#ifdef WORDS_BIGENDIAN
</span><span class="hs-identifier">word32BE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">word32Host</span><span class="hs-cpp">
#else
</span><span id="word32BE"><span class="annot"><span class="annottext">word32BE :: FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32BE"><span class="hs-identifier hs-var hs-var">word32BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (Word32 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word32
forall a. Int -&gt; (a -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#fixedPrim"><span class="hs-identifier hs-var">fixedPrim</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">((Word32 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word32)
-&gt; (Word32 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word32
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679070782"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679070782"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679070781"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070781"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-112"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070781"><span class="hs-identifier hs-var">p</span></a></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int -&gt; Word32
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w32"><span class="hs-identifier hs-var">shiftr_w32</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679070782"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">24</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070781"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int -&gt; Word32
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w32"><span class="hs-identifier hs-var">shiftr_w32</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679070782"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070781"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int -&gt; Word32
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w32"><span class="hs-identifier hs-var">shiftr_w32</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679070782"><span class="hs-identifier hs-var">w</span></a></span><span>  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070781"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679070782"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- | Encoding 'Word32's in little endian format.</span><span>
</span><span id="line-119"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32LE"><span class="hs-pragma hs-type">word32LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-120"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32LE"><span class="hs-identifier hs-type">word32LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-cpp">
#ifdef WORDS_BIGENDIAN
</span><span class="hs-identifier">word32LE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fixedPrim</span><span> </span><span class="hs-number">4</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">w</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">p</span><span>               </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">w</span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">w</span><span>  </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">3</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span id="word32LE"><span class="annot"><span class="annottext">word32LE :: FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32LE"><span class="hs-identifier hs-var hs-var">word32LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32Host"><span class="hs-identifier hs-var">word32Host</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- on a little endian machine:</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- word32LE w32 = fixedPrim 4 (\w p -&gt; poke (castPtr p) w32)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="hs-comment">-- | Encoding 'Word64's in big endian format.</span><span>
</span><span id="line-135"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64BE"><span class="hs-pragma hs-type">word64BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-136"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64BE"><span class="hs-identifier hs-type">word64BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-cpp">
#ifdef WORDS_BIGENDIAN
</span><span class="hs-identifier">word64BE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">word64Host</span><span class="hs-cpp">
#else
</span><span class="hs-cpp">#if WORD_SIZE_IN_BITS &lt; 64
</span><span class="hs-comment">--</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- To avoid expensive 64 bit shifts on 32 bit machines, we cast to</span><span>
</span><span id="line-143"></span><span class="hs-comment">-- Word32, and write that</span><span>
</span><span id="line-144"></span><span class="hs-comment">--</span><span>
</span><span id="line-145"></span><span class="hs-identifier">word64BE</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-146"></span><span>    </span><span class="hs-identifier">fixedPrim</span><span> </span><span class="hs-number">8</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">w</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">32</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word32</span><span>
</span><span id="line-148"></span><span>            </span><span class="hs-identifier">b</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">w</span><span>                 </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word32</span><span>
</span><span id="line-149"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">p</span><span>               </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">a</span><span>  </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">3</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">a</span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-153"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">5</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">6</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">b</span><span>  </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">7</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">b</span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span id="word64BE"><span class="annot"><span class="annottext">word64BE :: FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64BE"><span class="hs-identifier hs-var hs-var">word64BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (Word64 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word64
forall a. Int -&gt; (a -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#fixedPrim"><span class="hs-identifier hs-var">fixedPrim</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span> </span><span class="annot"><span class="annottext">((Word64 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word64)
-&gt; (Word64 -&gt; Ptr Word8 -&gt; IO ()) -&gt; FixedPrim Word64
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679070779"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679070778"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-159"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">56</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">48</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">40</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">32</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">24</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">5</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
</span><a href="Data.ByteString.Builder.Prim.Internal.UncheckedShifts.html#shiftr_w64"><span class="hs-identifier hs-var">shiftr_w64</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span>  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span>    </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Word8 -&gt; IO ()
forall a. Storable a =&gt; Ptr a -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#poke"><span class="hs-identifier hs-var">poke</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621679070778"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">7</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679070779"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#endif
</span><span>
</span><span id="line-170"></span><span class="hs-comment">-- | Encoding 'Word64's in little endian format.</span><span>
</span><span id="line-171"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64LE"><span class="hs-pragma hs-type">word64LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-172"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64LE"><span class="hs-identifier hs-type">word64LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-cpp">
#ifdef WORDS_BIGENDIAN
</span><span class="hs-cpp">#if WORD_SIZE_IN_BITS &lt; 64
</span><span class="hs-identifier">word64LE</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-176"></span><span>    </span><span class="hs-identifier">fixedPrim</span><span> </span><span class="hs-number">8</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">w</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-177"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">32</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word32</span><span>
</span><span id="line-178"></span><span>            </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">w</span><span>                 </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word32</span><span>
</span><span id="line-179"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span class="hs-special">)</span><span>             </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">a</span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">a</span><span>  </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">3</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">b</span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">5</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">b</span><span>  </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">6</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>        </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">7</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w32</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span class="hs-identifier">word64LE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fixedPrim</span><span> </span><span class="hs-number">8</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">w</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">p</span><span>               </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">w</span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span>  </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">3</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">24</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">32</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">5</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">40</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">6</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">48</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">p</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">7</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">shiftr_w64</span><span> </span><span class="hs-identifier">w</span><span> </span><span class="hs-number">56</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#else
</span><span id="word64LE"><span class="annot"><span class="annottext">word64LE :: FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64LE"><span class="hs-identifier hs-var hs-var">word64LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64Host"><span class="hs-identifier hs-var">word64Host</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="hs-comment">-- | Encode a single native machine 'Word'. The 'Word's is encoded in host order,</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- host endian form, for the machine you are on. On a 64 bit machine the 'Word'</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way</span><span>
</span><span id="line-206"></span><span class="hs-comment">-- are not portable to different endian or word sized machines, without</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- conversion.</span><span>
</span><span id="line-208"></span><span class="hs-comment">--</span><span>
</span><span id="line-209"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#wordHost"><span class="hs-pragma hs-type">wordHost</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-210"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#wordHost"><span class="hs-identifier hs-type">wordHost</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span>
</span><span id="line-211"></span><span id="wordHost"><span class="annot"><span class="annottext">wordHost :: FixedPrim Word
</span><a href="Data.ByteString.Builder.Prim.Binary.html#wordHost"><span class="hs-identifier hs-var hs-var">wordHost</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span class="hs-comment">-- | Encoding 'Word16's in native host order and host endianness.</span><span>
</span><span id="line-214"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16Host"><span class="hs-pragma hs-type">word16Host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-215"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word16Host"><span class="hs-identifier hs-type">word16Host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span>
</span><span id="line-216"></span><span id="word16Host"><span class="annot"><span class="annottext">word16Host :: FixedPrim Word16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word16Host"><span class="hs-identifier hs-var hs-var">word16Host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word16
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="hs-comment">-- | Encoding 'Word32's in native host order and host endianness.</span><span>
</span><span id="line-219"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32Host"><span class="hs-pragma hs-type">word32Host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-220"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word32Host"><span class="hs-identifier hs-type">word32Host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-221"></span><span id="word32Host"><span class="annot"><span class="annottext">word32Host :: FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32Host"><span class="hs-identifier hs-var hs-var">word32Host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="hs-comment">-- | Encoding 'Word64's in native host order and host endianness.</span><span>
</span><span id="line-224"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64Host"><span class="hs-pragma hs-type">word64Host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-225"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#word64Host"><span class="hs-identifier hs-type">word64Host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span>
</span><span id="line-226"></span><span id="word64Host"><span class="annot"><span class="annottext">word64Host :: FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64Host"><span class="hs-identifier hs-var hs-var">word64Host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- Int encodings</span><span>
</span><span id="line-231"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-232"></span><span class="hs-comment">--</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- We rely on 'fromIntegral' to do a loss-less conversion to the corresponding</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- 'Word' type</span><span>
</span><span id="line-235"></span><span class="hs-comment">--</span><span>
</span><span id="line-236"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span class="hs-comment">-- | Encoding single signed bytes as-is.</span><span>
</span><span id="line-239"></span><span class="hs-comment">--</span><span>
</span><span id="line-240"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int8"><span class="hs-pragma hs-type">int8</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-241"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int8"><span class="hs-identifier hs-type">int8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int8"><span class="hs-identifier hs-type">Int8</span></a></span><span>
</span><span id="line-242"></span><span id="int8"><span class="annot"><span class="annottext">int8 :: FixedPrim Int8
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int8"><span class="hs-identifier hs-var hs-var">int8</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int8 -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int8 -&gt; Word8) -&gt; FixedPrim Word8 -&gt; FixedPrim Int8
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word8
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word8"><span class="hs-identifier hs-var">word8</span></a></span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span class="hs-comment">-- | Encoding 'Int16's in big endian format.</span><span>
</span><span id="line-245"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16BE"><span class="hs-pragma hs-type">int16BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-246"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16BE"><span class="hs-identifier hs-type">int16BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span>
</span><span id="line-247"></span><span id="int16BE"><span class="annot"><span class="annottext">int16BE :: FixedPrim Int16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int16BE"><span class="hs-identifier hs-var hs-var">int16BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int16 -&gt; Word16
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int16 -&gt; Word16) -&gt; FixedPrim Word16 -&gt; FixedPrim Int16
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word16BE"><span class="hs-identifier hs-var">word16BE</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | Encoding 'Int16's in little endian format.</span><span>
</span><span id="line-250"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16LE"><span class="hs-pragma hs-type">int16LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-251"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16LE"><span class="hs-identifier hs-type">int16LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span>
</span><span id="line-252"></span><span id="int16LE"><span class="annot"><span class="annottext">int16LE :: FixedPrim Int16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int16LE"><span class="hs-identifier hs-var hs-var">int16LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int16 -&gt; Word16
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int16 -&gt; Word16) -&gt; FixedPrim Word16 -&gt; FixedPrim Int16
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word16LE"><span class="hs-identifier hs-var">word16LE</span></a></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span class="hs-comment">-- | Encoding 'Int32's in big endian format.</span><span>
</span><span id="line-255"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32BE"><span class="hs-pragma hs-type">int32BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-256"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32BE"><span class="hs-identifier hs-type">int32BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span>
</span><span id="line-257"></span><span id="int32BE"><span class="annot"><span class="annottext">int32BE :: FixedPrim Int32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int32BE"><span class="hs-identifier hs-var hs-var">int32BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int32 -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int32 -&gt; Word32) -&gt; FixedPrim Word32 -&gt; FixedPrim Int32
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32BE"><span class="hs-identifier hs-var">word32BE</span></a></span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-- | Encoding 'Int32's in little endian format.</span><span>
</span><span id="line-260"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32LE"><span class="hs-pragma hs-type">int32LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-261"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32LE"><span class="hs-identifier hs-type">int32LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span>
</span><span id="line-262"></span><span id="int32LE"><span class="annot"><span class="annottext">int32LE :: FixedPrim Int32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int32LE"><span class="hs-identifier hs-var hs-var">int32LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int32 -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int32 -&gt; Word32) -&gt; FixedPrim Word32 -&gt; FixedPrim Int32
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32LE"><span class="hs-identifier hs-var">word32LE</span></a></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="hs-comment">-- | Encoding 'Int64's in big endian format.</span><span>
</span><span id="line-265"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64BE"><span class="hs-pragma hs-type">int64BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-266"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64BE"><span class="hs-identifier hs-type">int64BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-267"></span><span id="int64BE"><span class="annot"><span class="annottext">int64BE :: FixedPrim Int64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int64BE"><span class="hs-identifier hs-var hs-var">int64BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Word64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Word64) -&gt; FixedPrim Word64 -&gt; FixedPrim Int64
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64BE"><span class="hs-identifier hs-var">word64BE</span></a></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="hs-comment">-- | Encoding 'Int64's in little endian format.</span><span>
</span><span id="line-270"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64LE"><span class="hs-pragma hs-type">int64LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-271"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64LE"><span class="hs-identifier hs-type">int64LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-272"></span><span id="int64LE"><span class="annot"><span class="annottext">int64LE :: FixedPrim Int64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int64LE"><span class="hs-identifier hs-var hs-var">int64LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Word64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Word64) -&gt; FixedPrim Word64 -&gt; FixedPrim Int64
forall (f :: * -&gt; *) b a. Contravariant f =&gt; (b -&gt; a) -&gt; f a -&gt; f b
</span><a href="Data.ByteString.Builder.Prim.Internal.html#%3E%24%3C"><span class="hs-operator hs-var">&gt;$&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64LE"><span class="hs-identifier hs-var">word64LE</span></a></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span class="hs-comment">-- | Encode a single native machine 'Int'. The 'Int's is encoded in host order,</span><span>
</span><span id="line-276"></span><span class="hs-comment">-- host endian form, for the machine you are on. On a 64 bit machine the 'Int'</span><span>
</span><span id="line-277"></span><span class="hs-comment">-- is an 8 byte value, on a 32 bit machine, 4 bytes. Values encoded this way</span><span>
</span><span id="line-278"></span><span class="hs-comment">-- are not portable to different endian or integer sized machines, without</span><span>
</span><span id="line-279"></span><span class="hs-comment">-- conversion.</span><span>
</span><span id="line-280"></span><span class="hs-comment">--</span><span>
</span><span id="line-281"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#intHost"><span class="hs-pragma hs-type">intHost</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-282"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#intHost"><span class="hs-identifier hs-type">intHost</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-283"></span><span id="intHost"><span class="annot"><span class="annottext">intHost :: FixedPrim Int
</span><a href="Data.ByteString.Builder.Prim.Binary.html#intHost"><span class="hs-identifier hs-var hs-var">intHost</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-comment">-- | Encoding 'Int16's in native host order and host endianness.</span><span>
</span><span id="line-286"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16Host"><span class="hs-pragma hs-type">int16Host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-287"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int16Host"><span class="hs-identifier hs-type">int16Host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span>
</span><span id="line-288"></span><span id="int16Host"><span class="annot"><span class="annottext">int16Host :: FixedPrim Int16
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int16Host"><span class="hs-identifier hs-var hs-var">int16Host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int16
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- | Encoding 'Int32's in native host order and host endianness.</span><span>
</span><span id="line-291"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32Host"><span class="hs-pragma hs-type">int32Host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-292"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int32Host"><span class="hs-identifier hs-type">int32Host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span>
</span><span id="line-293"></span><span id="int32Host"><span class="annot"><span class="annottext">int32Host :: FixedPrim Int32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int32Host"><span class="hs-identifier hs-var hs-var">int32Host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int32
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span class="hs-comment">-- | Encoding 'Int64's in native host order and host endianness.</span><span>
</span><span id="line-296"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64Host"><span class="hs-pragma hs-type">int64Host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-297"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#int64Host"><span class="hs-identifier hs-type">int64Host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-298"></span><span id="int64Host"><span class="annot"><span class="annottext">int64Host :: FixedPrim Int64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#int64Host"><span class="hs-identifier hs-var hs-var">int64Host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int64
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span class="hs-comment">-- IEEE Floating Point Numbers</span><span>
</span><span id="line-301"></span><span class="hs-comment">------------------------------</span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span class="hs-comment">-- | Encode a 'Float' in big endian format.</span><span>
</span><span id="line-304"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatBE"><span class="hs-pragma hs-type">floatBE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-305"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatBE"><span class="hs-identifier hs-type">floatBE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>
</span><span id="line-306"></span><span id="floatBE"><span class="annot"><span class="annottext">floatBE :: FixedPrim Float
</span><a href="Data.ByteString.Builder.Prim.Binary.html#floatBE"><span class="hs-identifier hs-var hs-var">floatBE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32 -&gt; FixedPrim Float
</span><a href="Data.ByteString.Builder.Prim.Internal.Floating.html#encodeFloatViaWord32F"><span class="hs-identifier hs-var">encodeFloatViaWord32F</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32BE"><span class="hs-identifier hs-var">word32BE</span></a></span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="hs-comment">-- | Encode a 'Float' in little endian format.</span><span>
</span><span id="line-309"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatLE"><span class="hs-pragma hs-type">floatLE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-310"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatLE"><span class="hs-identifier hs-type">floatLE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>
</span><span id="line-311"></span><span id="floatLE"><span class="annot"><span class="annottext">floatLE :: FixedPrim Float
</span><a href="Data.ByteString.Builder.Prim.Binary.html#floatLE"><span class="hs-identifier hs-var hs-var">floatLE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32 -&gt; FixedPrim Float
</span><a href="Data.ByteString.Builder.Prim.Internal.Floating.html#encodeFloatViaWord32F"><span class="hs-identifier hs-var">encodeFloatViaWord32F</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word32LE"><span class="hs-identifier hs-var">word32LE</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="hs-comment">-- | Encode a 'Double' in big endian format.</span><span>
</span><span id="line-314"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleBE"><span class="hs-pragma hs-type">doubleBE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-315"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleBE"><span class="hs-identifier hs-type">doubleBE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span>
</span><span id="line-316"></span><span id="doubleBE"><span class="annot"><span class="annottext">doubleBE :: FixedPrim Double
</span><a href="Data.ByteString.Builder.Prim.Binary.html#doubleBE"><span class="hs-identifier hs-var hs-var">doubleBE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64 -&gt; FixedPrim Double
</span><a href="Data.ByteString.Builder.Prim.Internal.Floating.html#encodeDoubleViaWord64F"><span class="hs-identifier hs-var">encodeDoubleViaWord64F</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64BE"><span class="hs-identifier hs-var">word64BE</span></a></span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span class="hs-comment">-- | Encode a 'Double' in little endian format.</span><span>
</span><span id="line-319"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleLE"><span class="hs-pragma hs-type">doubleLE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-320"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleLE"><span class="hs-identifier hs-type">doubleLE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span>
</span><span id="line-321"></span><span id="doubleLE"><span class="annot"><span class="annottext">doubleLE :: FixedPrim Double
</span><a href="Data.ByteString.Builder.Prim.Binary.html#doubleLE"><span class="hs-identifier hs-var hs-var">doubleLE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64 -&gt; FixedPrim Double
</span><a href="Data.ByteString.Builder.Prim.Internal.Floating.html#encodeDoubleViaWord64F"><span class="hs-identifier hs-var">encodeDoubleViaWord64F</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
</span><a href="Data.ByteString.Builder.Prim.Binary.html#word64LE"><span class="hs-identifier hs-var">word64LE</span></a></span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- | Encode a 'Float' in native host order and host endianness. Values written</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- this way are not portable to different endian machines, without conversion.</span><span>
</span><span id="line-326"></span><span class="hs-comment">--</span><span>
</span><span id="line-327"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatHost"><span class="hs-pragma hs-type">floatHost</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-328"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#floatHost"><span class="hs-identifier hs-type">floatHost</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>
</span><span id="line-329"></span><span id="floatHost"><span class="annot"><span class="annottext">floatHost :: FixedPrim Float
</span><a href="Data.ByteString.Builder.Prim.Binary.html#floatHost"><span class="hs-identifier hs-var hs-var">floatHost</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Float
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="hs-comment">-- | Encode a 'Double' in native host order and host endianness.</span><span>
</span><span id="line-332"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleHost"><span class="hs-pragma hs-type">doubleHost</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-333"></span><span class="annot"><a href="Data.ByteString.Builder.Prim.Binary.html#doubleHost"><span class="hs-identifier hs-type">doubleHost</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.ByteString.Builder.Prim.Internal.html#FixedPrim"><span class="hs-identifier hs-type">FixedPrim</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span>
</span><span id="line-334"></span><span id="doubleHost"><span class="annot"><span class="annottext">doubleHost :: FixedPrim Double
</span><a href="Data.ByteString.Builder.Prim.Binary.html#doubleHost"><span class="hs-identifier hs-var hs-var">doubleHost</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Double
forall a. Storable a =&gt; FixedPrim a
</span><a href="Data.ByteString.Builder.Prim.Internal.html#storableToF"><span class="hs-identifier hs-var">storableToF</span></a></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span></pre></body></html>